//引入路由模块
import VueRouter from "vue-router";
// 引入vue模块
import Vue from "vue"

// 使用路由模块，将路由模块挂给vue
Vue.use(VueRouter)
// 路由数组
var routes = [
    {
        name:"",
        path:"/",
        component:()=> import("../views/LoginView.vue")
    },
    {
        name:"main",
        path:"/main",
        component:()=> import("../views/MainView.vue"),
        children:[
            {
                name:"admin",
                path:"/admin",
                component:()=>import("@/views/AdminView.vue")
            },
            {
                name:"depart",
                path:"/system/depart",
                component:()=>import("@/views/systemMana/DepartmentView.vue")
            },
            {
                name:"detail",
                path:"/system/detail",
                component:()=>import("@/views/systemMana/DetailView.vue")
            },
            {
                name:"guidanceSheet",
                path:"/guidanceSheet",
                component:()=>import("@/views/systemMana/GuidanceSheetView.vue")
            },
            {
                name:"role",
                path:"/permission/role",
                component:()=>import("@/views/permissionView/RoleView.vue")
            },
            {
                name:"project",
                path:"/system/project",
                component:()=>import("@/views/systemMana/ProjectView.vue")
            },
            {
                name:"combination",
                path:"/system/combination",
                component:()=>import("@/views/systemMana/CombinationView.vue")
            },
            {
                name:"welcome",
                path:"/homepage/welcome",
                component:()=>import("@/views/homepage/WelcomeView.vue")
            },
            {
                name:"staff",
                path:"/system/staff",
                component:()=>import("@/views/systemMana/StaffView.vue")
            },
            {
                name:"patient",
                path:"/system/patient",
                component:()=>import("@/views/systemMana/PatientView.vue")
            },
            {
                name:"operational",
                path:"/systemTool/operational",
                component:()=>import("@/views/systemTool/OperationalView.vue")
            },
            {
                name:"test",
                path:"/test",
                component:()=>import("@/views/systemTool/testView.vue")
            },
            {
                name:"order",
                path:"/systemTool/order",
                component:()=>import("@/views/systemMana/OrderView.vue")
            },
            {
                name:"work",
                path:"/doctor/order",
                component:()=>import("@/views/doctorPage/ExamWorkView.vue")
            },
            {
                name:"summary",
                path:"/doctor/summary",
                component:()=>import("@/views/doctorPage/ExamSummaryView.vue")
            },
        ]
    },
    {
        name:"login",
        path:"/login",
        component:()=> import("../views/LoginView.vue")
    },
    {
        name:"reg",
        path:"/reg",
        component:()=> import("../views/RegisterView.vue")
    },
    {
        name:"forgetPwd",
        path:"/forgetPwd",
        component:()=> import("../views/ForgetPwd.vue")
    },
  
];
// 路由器
var router = new VueRouter({
    mode:"hash",
    routes
})


// 抛出路由器
export default router